use crate::cmd::flag::parse;
use std::collections::HashMap;

const SYSTEM_VERSION: &str = "v0.0.3";

#[allow(dead_code)]
pub fn default(args: HashMap<String, String>, cmdtree: &parse::FlagTree) -> Result<(), String> {
    log_info_ln!("runing exe is: {}", &cmdtree.name);
    log_debug_ln!("输入以下全局参数：");
    for arg in args.iter() {
        log_debug_ln!("key:{}  value:{}", arg.0, arg.1);
    }
    Ok(())
}

pub fn exit(_: HashMap<String, String>, _: &parse::FlagTree) -> Result<(), String> {
    log_info_ln!("任务结束");
    Ok(())
}

pub fn version(_: HashMap<String, String>, _: &parse::FlagTree) -> Result<(), String> {
    println!("当前版本是：{}", SYSTEM_VERSION);
    Ok(())
}
